<nz-tab>
    <ng-template #nzTabHeading>
        教师管理
    </ng-template>
    <div class="search-add-box">
        教师姓名：<nz-input [nzPlaceHolder]="'请输入查询教师姓名'"  [nzSize]="'large'"  [(ngModel)]="searchValue" style="width: 200px;"></nz-input>
        <button nz-button type="submit" class="mar-left" [nzType]="'primary'" [nzSize]="'large'" (click)="search()">查询</button>
        <button nz-button class="btn-right" [nzType]="'default'" [nzSize]="'large'" *ngIf="_checkLength > 0" (click)="allDelete()">
            <span>批量删除</span>
        </button>
        <button nz-button class="btn-right" (click)="modal('add', '')" [nzType]="'primary'" [nzSize]="'large'">
            <i class="anticon anticon-plus"></i><span>新建</span>
        </button>
    </div>
    <nz-table #nzTable1 [nzDataSource]="data" [nzPageSize]="10" (nzDataChange)="_displayDataChange($event)" (nzPageIndexChange)="_refreshStatus()" (nzPageSizeChange)="_refreshStatus()"  [nzLoading]="_loading">
        <thead nz-thead>
        <tr>
            <th nz-th [nzCheckbox]="true">
                <label nz-checkbox [(ngModel)]="_allChecked" [nzIndeterminate]="_indeterminate" (ngModelChange)="_checkAll($event)">
                </label>
            </th>
            <th  nz-th><span>教师姓名</span></th>
            <th  nz-th><span>所在院校</span></th>
            <th  nz-th><span>手机号码</span></th>
            <th  nz-th><span>电子邮箱</span></th>
            <th  nz-th><span>状态</span></th>
            <th  nz-th><span>操作</span></th>
        </tr>
        </thead>
        <tbody nz-tbody>
        <tr nz-tbody-tr *ngFor="let data of nzTable1.data;let i = index">
            <td nz-td [nzCheckbox]="true">
                <label nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_refreshStatus($event)">
                </label>
            </td>
            <td nz-td>{{data.T_name}}</td>
            <td nz-td>{{data.T_college}}</td>
            <td nz-td>{{data.T_phone}}</td>
            <td nz-td>{{data.T_email}}</td>
            <td nz-td>{{Status[i]}}</td>
            <td nz-td>
                    <span>
                      <a (click)="info(contentTpl,data,Status[i])">查看</a>
                      <span nz-table-divider></span>
                      <a (click)="modal ('update', data)">修改</a>
                      <span nz-table-divider></span>
                      <a (click)="showConfirm(data)">删除</a>
                    </span>
            </td>
        </tr>
        </tbody>
    </nz-table>
    <nz-modal  [nzWrapClassName]="'vertical-center-modal'" [nzVisible]="modalVisible1" [nzTitle]="popTitle" [nzConfirmLoading]="loading" [nzContent]="modalContent1"
               (nzOnCancel)="modalVisible1=false" (nzOnOk)="save()">
        <ng-template #modalContent1>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-label class="til-box">教师姓名：</div>
                <div nz-form-control class="flex-1">
                    <nz-input [(ngModel)]="Tname" name="description" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                </div>
                <div nz-form-label class="til-box">院校名称：</div>
                <div nz-form-control class="flex-1">
                    <nz-input [(ngModel)]="Tschool" name="description" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                </div>
            </div>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-label class="til-box">手机号码：</div>
                <div nz-form-control class="flex-1">
                    <nz-input [(ngModel)]="Tphone" name="description" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                </div>
                <div nz-form-label class="til-box">电子邮箱：</div>
                <div nz-form-control class="flex-1">
                    <nz-input [(ngModel)]="Temail" name="description" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                </div>
            </div>
            <div nz-form-item nz-row>
                <div nz-form-label class="til-box">教师状态：</div>
                <div nz-form-control class="flex-1">
                    <nz-select style="width: 407px;" [nzPlaceHolder]="'请选择'" [(ngModel)]="selectValue" [nzSize]="'large'" [nzShowSearch]="true">
                        <nz-option
                            *ngFor="let option of options"
                            [nzLabel]="option.label"
                            [nzValue]="option.value"
                            [nzDisabled]="option.disabled">
                        </nz-option>
                    </nz-select>
                </div>
            </div>
        </ng-template>
    </nz-modal>
    <ng-template #contentTpl>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-control class="flex-1">
                    <div nz-form-label class="til-box">教师姓名：</div>
                    {{Tname}}
                </div>
            </div>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-control class="flex-1">
                    <div nz-form-label class="til-box">院校名称：</div>
                    {{Tschool}}
                </div>
            </div>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-control class="flex-1">
                    <div nz-form-label class="til-box">手机号码：</div>
                    {{Tphone}}
                </div>
            </div>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-control class="flex-1">
                    <div nz-form-label class="til-box">电子邮箱：</div>
                    {{Temail}}
                </div>
            </div>
            <div nz-form-item nz-row>
                <div nz-form-control class="flex-1">
                    <div nz-form-label class="til-box">教师状态：</div>
                    {{selectValue}}
                </div>
            </div>
    </ng-template>
</nz-tab>
